package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.BillRecordMapper;
import com.ruoyi.system.domain.BillRecord;
import com.ruoyi.system.service.IBillRecordService;
import com.ruoyi.common.core.text.Convert;

/**
 * 账单记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-03-17
 */
@Service
public class BillRecordServiceImpl implements IBillRecordService 
{
    @Autowired
    private BillRecordMapper billRecordMapper;

    /**
     * 查询账单记录
     * 
     * @param id 账单记录主键
     * @return 账单记录
     */
    @Override
    public BillRecord selectBillRecordById(Long id)
    {
        return billRecordMapper.selectBillRecordById(id);
    }

    /**
     * 查询账单记录列表
     * 
     * @param billRecord 账单记录
     * @return 账单记录
     */
    @Override
    public List<BillRecord> selectBillRecordList(BillRecord billRecord)
    {
        return billRecordMapper.selectBillRecordList(billRecord);
    }

    /**
     * 新增账单记录
     * 
     * @param billRecord 账单记录
     * @return 结果
     */
    @Override
    public int insertBillRecord(BillRecord billRecord)
    {
        billRecord.setCreateTime(DateUtils.getNowDate());
        return billRecordMapper.insertBillRecord(billRecord);
    }

    /**
     * 修改账单记录
     * 
     * @param billRecord 账单记录
     * @return 结果
     */
    @Override
    public int updateBillRecord(BillRecord billRecord)
    {
        billRecord.setUpdateTime(DateUtils.getNowDate());
        return billRecordMapper.updateBillRecord(billRecord);
    }

    /**
     * 批量删除账单记录
     * 
     * @param ids 需要删除的账单记录主键
     * @return 结果
     */
    @Override
    public int deleteBillRecordByIds(String ids)
    {
        return billRecordMapper.deleteBillRecordByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除账单记录信息
     * 
     * @param id 账单记录主键
     * @return 结果
     */
    @Override
    public int deleteBillRecordById(Long id)
    {
        return billRecordMapper.deleteBillRecordById(id);
    }
}
